module Piston
  module PluginManager
    class SearchFile
      include System::Windows::Input::ICommand
      def initialize(project_view_model)
        @project_view_model = project_view_model
        @change_handlers = []
        @can_execute = true
      end

      def add_CanExecuteChanged(h)
        @change_handlers << h
      end

      def remove_CanExecuteChanged(h)
        @change_handlers.remove(h)
      end

      def can_execute(arg)
        @can_execute
      end

      def execute(arg)
        @project_view_model.perform_search
      end
    end
  end
end